import request from '@/utils/request'

export function getBillList(data) {
  return request({
    url: '/bill/month/page',
    method: 'post',
    data
  })
}

export function getYearBillList(data) {
  return request({
    url: '/bill/year/page',
    method: 'post',
    data
  })
}

export function addBill(data) {
  return request({
    url: '/bill',
    method: 'post',
    data
  })
}

export function editBill(data) {
  return request({
    url: '/bill',
    method: 'put',
    data
  })
}

export function billDetail(id) {
  return request({
    url: `/bill/detail/${id}`,
    method: 'get'
  })
}

export function getBillM(id) {
  return request({
    url: `/bill/month/${id}`,
    method: 'get'
  })
}

export function delBill(id) {
  return request({
    url: `/bill/${id}`,
    method: 'delete'
  })
}

export function billDetailStat(data) {
  return request({
    url: '/bill/detailStat',
    method: 'post',
    data
  })
}

export function recentBill(data) {
  return request({
    url: '/bill/recent',
    method: 'post',
    data
  })
}
